﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true"
    Codebehind="databaseList.aspx.cs" Inherits="CMS.admin.databaseList" Title="Hệ thống - Sao lưu CSDL" %>

<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript">
     
      function deleteRow(rowId)
      {           
        Grd1.Delete(Grd1.GetRowFromClientId(rowId));
      }   									   
   	  function onCallbackError(excString)
      {                
         alert(excString);        
         Grd1.Page(0); 
         return(true);
      }        
    </script>

    <div style="border: solid 1px #ccc;">
        <div id="toolbox">
            <div class="header" style="float: left; margin-left: -40px;">
                <img src="../images/Toolbox/icon-48-cpanel.png" alt="" id="imgHeader" />
                Sao lưu cơ sở dữ liệu
            </div>
            <div style="float: right;">
                <table class="toolbar">
                    <tr>
                        <td align="center">
                            <asp:LinkButton ID="btnBackup" runat="server" OnClick="btnBackup_Click" OnClientClick="return confirm('Bạn thực sự muốn sao lưu cơ sở dữ liệu?');">
                                <asp:Label ID="Label1" CssClass="Icon-32-UnArchive" runat="server" />
                                Sao lưu
                            </asp:LinkButton>
                        </td>
                        <td align="center">
                            <asp:LinkButton ID="btnDelete" runat="server" OnClick="btnDelete_Click" OnClientClick="return confirm('Bạn thực sự muốn xóa bản ghi này chứ?');">
                                <asp:Label ID="Label2" CssClass="Icon-32-Delete" runat="server" />
                                Xóa
                            </asp:LinkButton>
                        </td>
                        <td align="center">
                            <asp:LinkButton ID="btnClose" CausesValidation="false" runat="server" OnClick="btnClose_Click">
                                <asp:Label ID="Label4" CssClass="Icon-32-Cancel" runat="server" />
                                Đóng lại
                            </asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <p align="center">
        <br />
        <asp:Label ID="lblMessage" runat="server" BackColor="White" BorderColor="White" ForeColor="Red"></asp:Label>
    </p>
    <div id="content-box">
        <div class="t">
            <div class="t">
                <div class="t">
                </div>
            </div>
        </div>
        <div class="m" style="height: 520px;">
            <br />
            <table cellpadding="5" cellspacing="2" width="100%">
                <tr>
                    <td>
                        <ComponentArt:Grid ID="Grd1" EnableViewState="true" AllowEditing="true" EditOnClickSelectedItem="false"
                            ShowHeader="False" CssClass="Grid" KeyboardEnabled="false" FooterCssClass="GridFooter"
                            RunningMode="Callback" AutoCallBackOnDelete="true" AllowHtmlContent="true" PagerStyle="Numbered"
                            PagerTextCssClass="PagerText" PageSize="15" ImagesBaseUrl="../images/" LoadingPanelClientTemplateId="LoadingFeedbackTemplate"
                            Width="830" LoadingPanelPosition="MiddleCenter" runat="server">
                            <Levels>
                                <ComponentArt:GridLevel RowCssClass="Row" SelectedRowCssClass="SelectedRow" AlternatingRowCssClass="AlternatingRow"
                                    DataCellCssClass="DataCell" HeadingCellCssClass="HeadingCell" HeadingTextCssClass="HeadingCellText"
                                    SortAscendingImageUrl="asc.gif" SortDescendingImageUrl="desc.gif" SortImageWidth="9"
                                    SortImageHeight="5">
                                    <Columns>
                                        <ComponentArt:GridColumn Align="Center" DataField="No" HeadingText="STT" Width="50"
                                            AllowSorting="False" />
                                        <ComponentArt:GridColumn Align="Center" DataField="FileName" HeadingText="#" Width="50"
                                            AllowSorting="False" DataCellServerTemplateId="TempSelect" />
                                        <ComponentArt:GridColumn Align="Center" DataField="FileName" HeadingText="Định dạng"
                                            Width="80" AllowSorting="False" DataCellClientTemplateId="TempFileType" />
                                        <ComponentArt:GridColumn Align="Center" DataField="FileName" HeadingText="Tên file"
                                            AllowSorting="False" Width="300" />
                                        <ComponentArt:GridColumn Align="Center" DataField="CreatedDate" HeadingText="Thời gian backup"
                                            Width="200" AllowSorting="False" />
                                        <ComponentArt:GridColumn Align="Center" DataField="Download" DataCellServerTemplateId="TempDownload"
                                            HeadingText="Tải xuống" Width="100" AllowSorting="False" />
                                    </Columns>
                                </ComponentArt:GridLevel>
                            </Levels>
                            <ServerTemplates>
                                <ComponentArt:GridServerTemplate ID="TempDownload" runat="server">
                                    <Template>
                                        <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                            <tr>
                                                <td align="center">
                                                    <asp:LinkButton ID="Download" runat="server" OnCommand="DownloadClick" CommandName="DownloadClick"
                                                        Font-Size="Small" CommandArgument='<%#Container.DataItem["FileName"]%>'>
                                                                            <img border="0" src="../images/icon/download.gif" alt="Tải về máy"/>
                                                    </asp:LinkButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </Template>
                                </ComponentArt:GridServerTemplate>
                                <ComponentArt:GridServerTemplate ID="TempSelect" runat="server">
                                    <Template>
                                        <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                            <tr>
                                                <td class="CellText">
                                                    <input type="checkbox" value='<%# Container.DataItem["FileName"] %>' id="FileName"
                                                        name="FileName" />
                                                </td>
                                            </tr>
                                        </table>
                                    </Template>
                                </ComponentArt:GridServerTemplate>
                            </ServerTemplates>
                            <ClientTemplates>
                                <ComponentArt:ClientTemplate ID="TempFileType" runat="server">
                                    <table cellspacing="0" cellpadding="0" border="0" align="Center">
                                        <tr align="Center">
                                            <td style="text-align: center;">
                                                <img src="../images/icon/zip.gif" border="0" /></td>
                                        </tr>
                                    </table>
                                </ComponentArt:ClientTemplate>
                                <ComponentArt:ClientTemplate ID="LoadingFeedbackTemplate" runat="server">
                                    <table cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td style="font-size: 10px;">
                                                Đang tải...&nbsp;</td>
                                            <td>
                                                <img src="../images/spinner.gif" border="0"></td>
                                        </tr>
                                    </table>
                                </ComponentArt:ClientTemplate>
                            </ClientTemplates>
                        </ComponentArt:Grid>
                    </td>
                </tr>
            </table>
            <div class="clr">
            </div>
        </div>
        <div class="b">
            <div class="b">
                <div class="b">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
